home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / qns310.arc / Q-RELAY.SCR < prev    next >
Text File  |  1991-04-28  |  3KB  |  78 lines

  1. ;┌──────────────────────────────────────────────────────────────────────────┐
  2. ;│ Q-RELAY.SCR        Copyright 1988-1990 by Rik Brown                      │
  3. ;│                                                                          │
  4. ;│                    PCRELAY hub door script                               │
  5. ;└──────────────────────────────────────────────────────────────────────────┘
  6.  
  7.   IF "$4" = "$maxulmail"          LOGOFF ; Counter check: ul attempts
  8.   INCR 4                                 ; Increment mail upload counter
  9.  
  10.   SEND "^~OPEN $maildoor^M"              ; Open netmail door
  11.   WHEN                                   ; Clear all WHENs
  12.   WHEN "assword to"  "^~^~^~$mailpswd^M" ; "password to open the DOOR"
  13.   WHEN "assword for" "^~^~^~$mailpswd^M" ; "Incorrect Password for DOOR"
  14.   WHEN "(Dots will echo)"     PCBCOMMAND ; Means dumped out of door
  15.   WHEN "NO CARRIER"         DIALSEQUENCE ; Error handling (carrier loss)
  16.  
  17.   TIMEOUT 30                DIALSEQUENCE ; Wait max 30 secs for next line
  18.   WAITFOR "*"
  19.  
  20. ULMAIL:
  21.  
  22.   IF "$4" = "$maxulmail"          LOGOFF ; Counter check: ul attempts
  23.   INCR 4                                 ; Increment mail upload counter
  24.  
  25.   DOS "qnssz.bat $maildir $mailul"       ; Call transfer BAT file
  26.   IF $OFFLINE               DIALSEQUENCE ; Error handling (carrier loss)
  27.  
  28.   CLRSCR                                 ; Exit DSZ status line
  29.   EXIST $maildir\SUCCESS.SND      DLMAIL ; Set to your location
  30.   GOTO ULMAIL
  31.  
  32. DLMAIL:
  33.  
  34.   EXIST $maildir\SUCCESS.RCV      LOGOFF ; Error handling (prior carrier loss)
  35.   IF "$3" = "$maxDLMAIL"          LOGOFF ; Counter check: dl attempts
  36.   INCR 3                                 ; Increment DLMAIL counter
  37.  
  38.   TIMEOUT 30                      LOGOFF ; Keep large
  39.   WAITFOR "*"
  40.   TIMEOUT 1000              DIALSEQUENCE ; Wait max 10 minutes for download
  41.  
  42.   DOS "if exist $maildir\$mailDL del $maildir\$mailDL"
  43. ; Delete any prior non-completed Zmodem download of mail
  44.  
  45.   DOS "qnsrz.bat $maildir $mailDL"       ; Call transfer BAT file
  46.  
  47.   IF $OFFLINE               DIALSEQUENCE ; Error handling (carrier loss)
  48.   CLRSCR                                 ; Exit DSZ status line
  49.  
  50.   EXIST $maildir\SUCCESS.RCV     SUCCESS ; Transfers succeeded both wasy
  51.   GOTO                            DLMAIL ; Try again if unsuccessful
  52.  
  53. SUCCESS:
  54.   NOTE                                                                       
  55.   NOTE ----------------------------------------------------------------------
  56.   NOTE SUCCESSFUL UP AND DOWNLOAD OF RELAY MAIL PACKETS. LOGGING OFF....
  57.   NOTE ----------------------------------------------------------------------
  58.   NOTE                                                                       
  59. ; ALT-255 at end of 1st and last NOTE line above (do not alter)
  60.  
  61.   DOS "if exist $maildir\SUCCESS.RCV del $maildir\$mailUL"
  62.  
  63. ; The above line should not be reached unless both the send and receive of
  64. ; mail was successful. Thereafter the send file will be deleted. But if there
  65. ; was an error, the send file will be uploaded the next time the script is
  66. ; run. In this way no replies are lost. Pending mail files must be success-
  67. ; fully uploaded before a totally new upload file can be created.
  68.  
  69.   RETURN
  70.  
  71. PCBCOMMAND:
  72.   SEND "^~^~$pword^M"
  73.   SCRIPT Q-LOGOFF.SCR
  74. DIALSEQUENCE:
  75.   SCRIPT Q-LOGON.SCR
  76. LOGOFF:
  77.   SCRIPT Q-LOGOFF.SCR
  78.